/**
 * 求 a 与 b之间的随机数
 */
function fn(a,b){
    //获取一个随机数 Math.random();
    // var ran = Math.random();
    // //将这个随机数扩大(b-a+1)的倍数
    // var res = ran*(Math.abs(b-a)+1)
    // //将这个数字向下取整+a
    // return Math.floor(res)+Math.min(a,b)
    return Math.floor(Math.random()*(Math.abs(b-a)+1))+Math.min(a,b)
}

function getColor(){
    var res1 = fn(0,15)//FF
    var res2 = fn(0,15)//FF
    var res3 = fn(0,15)//FF
    var res4 = fn(0,15)//FF
    var res5 = fn(0,15)//FF
    var res6 = fn(0,15)//FF
    //将res转换成16进制
    var hex1 = res1.toString(16)
    var hex2 = res2.toString(16)
    var hex3 = res3.toString(16)
    var hex4 = res4.toString(16)
    var hex5 = res5.toString(16)
    var hex6 = res6.toString(16)
    console.log("#"+hex1+hex2+hex3+hex4+hex5+hex6);
    return "#"+hex1+hex2+hex3+hex4+hex5+hex6
}